package cn.rongdao.jrkabao.model.creditcard;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/9/11
 */

public class AddCreditCardRemindModel extends BaseKaMaoModel {

    public static AddCreditCardRemindModel getInstance() {
        return getPresent(AddCreditCardRemindModel.class);
    }

    public void execute(String amount, String bankName, String cardNumber, String billDay, String id, String repayDay, String userName, String bankCode, Observer<String> observer) {
        addParamStrings("type", "2");
        addParamStrings("amount", FRString.valueOf(amount));
        addParamStrings("bank_name", FRString.valueOf(bankName));
        addParamStrings("bankcard_no", FRString.valueOf(cardNumber));
        addParamStrings("bill_day", FRString.valueOf(billDay));
        addParamStrings("id", FRString.valueOf(id));
        addParamStrings("repay_day", FRString.valueOf(repayDay));
        addParamStrings("user_name", FRString.valueOf(userName));
        addParamStrings("bank_code", FRString.valueOf(bankCode));
        Observable<String> observable = mServletApi.saveCreditRemind(mParams).map(new HttpFunction<String>());
        toSubscribe(observable, observer);
    }
}
